package cn.arts.assumejson.design_pattern.chap01;

/**
 * @author by <a href="mailto:ligang941012@gmail.com">gang.Li</a>
 * @since 3/26/2025 9:57 PM
 */
public abstract class Duck {
    FlyBehavior flyBehavior;
    QuackBehavior quackBehavior;

    public Duck() {
    }

    public abstract void display();

    public void performQuack() {
        quackBehavior.quack();
    }

    public void performFly() {
        flyBehavior.fly();
    }

    public void swim() {
        System.out.println("All ducks float, even decoy! ");
    }

}
